while True:
    try:
        num = input()
        a = num[:-6]
        b = num[-6:-3]
        c = num[-3:-2]
        d = num[-2:]
        if len(num)>=7:
            print(f'{a} million {b} thousand {c} hundred and {d}')
            break
    except:
        print('操作不合法，请重新输入')